package shop_board.action;


import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import shop_board.db.*;

public class BoardDeleteAction implements Action {
	 public ActionForward execute(HttpServletRequest request,HttpServletResponse response) 
	 	throws Exception{
		 
		ActionForward forward = new ActionForward();
		request.setCharacterEncoding("utf-8");
		
	   	boolean result=false;
	   
	   	String product_num=request.getParameter("product_num");
	   	
	   	BoardDAO boarddao=new BoardDAO();
	   	
	   	result=boarddao.boardDelete(product_num);
	   	if(result==false){
	   		System.out.println("BoardDeleteAction 26라인 에러");
	   		return null;
	   	}
	   	
	   	System.out.println("BoardDeleteAction 30 라인");
	   	forward.setRedirect(true);
   		forward.setPath("./BoardList.sh");
   		return forward;
	 }
}